package com.caimiao.miao.adapter;

import android.content.Context;
import android.view.View;
import android.widget.TextView;

import com.caimiao.miao.R;
import com.caimiao.miao.interfaces.IBaseAdapter;

import java.util.List;

public class SimpleSpinnerAdapter extends IBaseAdapter<String> {

    public SimpleSpinnerAdapter(Context context, List<String> dataLists) {
        super(context, dataLists);
    }

    @Override
    protected int getItemLayout() {
        return R.layout.item_text;
    }

    @Override
    protected void setLogic(int position, View convertView, BaseHolder holder) {
        final Holder mHolder = (Holder) holder;
        mHolder.mTvStr.setText(mDataList.get(position));
    }

    @Override
    protected BaseHolder createHolder(View convertView) {
        return new Holder(convertView);
    }

    private class Holder extends BaseHolder {
        private TextView mTvStr;

        public Holder(View convertView) {
            super(convertView);

            mTvStr = convertView.findViewById(R.id.item_tv_text);
        }
    }
}
